#ifndef _SMART_DEVICE_NEDPROTONL_PAD_H
#define _SMART_DEVICE_NEDPROTONL_PAD_H
#include <string>
#include <json/json.h>

#include <iostream>

using namespace std;

class SmartDeviceNetProtocol
{
public:
    void addOperation(const string &operation);
    void addCommand(const string &command);
    void addDeviceType(const string &type);
    void addDeivceNumber(const string &number);
    void addDevice(const string &type, const string &number);
    void addResult(const string &errmsg = "", const string &data = "");
    void addListItem(const string &operation, const string &type, const string &number);
    void addListResult(const string &errmsg);
    string toString();

    string getOperation(void) const;
    string getCommand(void) const;
    string getDeviceValue(const string &key);
    uint32_t getDeviceType(void) const;
    uint32_t getDeviceNumber(void) const;
    uint32_t getUserID(void);
    bool empty(void) const;
    static SmartDeviceNetProtocol fromJsonData(const string &jsonData);

private:
    Json::Value root;
    Json::Value objArray;
};

#endif